Skip to content

Add the ProbeGroup._global_contact_order concept.#446

Open
samuelgarcia wants to merge 8 commits into
SpikeInterface:mainfrom
samuelgarcia:group_order
Open

Add the ProbeGroup._global_contact_order concept.#446
samuelgarcia wants to merge 8 commits into
SpikeInterface:mainfrom
samuelgarcia:group_order

Conversation

@samuelgarcia

@samuelgarcia samuelgarcia commented Jun 9, 2026

Copy link
Copy Markdown
Member

#416 added a get_slices() at ProbeGroup level but this PR has enhanced after long debates and discussions the fact that the ProbeGroup has a strong problem : the order of contact with to_numpy()/from_numpy() or to_dict()/form_dict() can be lost!

This can append when contact of sevral Probe are interleaved. This was not possible before but given the Probegrorup.get_slice() contacts of several can be interleaved!

This PR add the hidden concept of ProbeGroup._global_contact_order.

  • this is backward compatible because None by default (aka natural contact order)
  • make possible pg2 = ProbeGroup.from_numpy(pg1.to_numpy(complete=True)) to maintain any abritory order
  • make possible pg2 = ProbeGroup.from_dict(pg1.to_dict()) to maintain any abritory order

The get_slice is now on top of to_numpy() after the ordering.

This PR is validated:

Important note: the _global_contact_order is NOT the global_device_channel_indices. It can be any order.
(Even if the main use case is to order by global_device_channel_indices on spikeinterface side).

In short, this PR garanty the order after the json write/read.

@alejoe91 @chrishalcrow @h-mayorquin

Test need to be done after validation.

@alejoe91

alejoe91 commented Jun 9, 2026

Copy link
Copy Markdown
Member

Thanks camarade. Can you fix tests?

@alejoe91

alejoe91 commented Jun 9, 2026

Copy link
Copy Markdown
Member

Comment thread src/probeinterface/probegroup.py Outdated
Co-authored-by: Alessio Buccino <alejoe9187@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants